console.log('我点英语插件background todo something~')

//接收来自content.js的消息
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
    if (request.action === 'SaveWord') {
        const data = request.data;
        let words = localStorage.getItem(data.userId);
        if (!words) {
            words = [];
        }
        words.push(data);
        localStorage.setItem(data.userId, words);
    }
    sendResponse('我是background.js，我已收到你的消息：' + JSON.stringify(request))
});
